build a dynamic table with sorting html